<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>积分墙</title>
</head>
<body>

</body>
<script>
    function getOS() {
        var u = navigator.userAgent, app = navigator.appVersion;
        var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1; //g
        var isIOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); //ios终端
        if (isAndroid) {
            //这个是安卓操作系统
            return "Android"
        }
        if (isIOS) {
            //这个是ios操作系统
            return "iOS"
        }else {
            return "";
        }
    }

    function getParam() {
        var url = location.search; //获取url中"?"符后的字串
        console.log("url",url)
        var theRequest = new Object();
        if (url.indexOf("?") != -1) {
            var str = url.substr(1);
            strs = str.split("&");
            for(var i = 0; i < strs.length; i ++) {
                theRequest[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
            }
        }
        return theRequest;
    }

    var link = '';
    var param = getParam()
    if(getOS() == 'Android'){
        var link = "https://tjgemor.gitee.io/antgeneralize/generalize.html?invite_code="+param.android_code;
    }else{
        var link = "https://tony_sirs.gitee.io/zqbgeneralize/generalize.html?invite_code="+param.ios_code;
    }

    window.location.href = link;

</script>
</html>
